import requeat from '../utils/request'
import { setHeaders } from './configHeaders'
//前缀
const urlPrefix = 'user'

const headers = {
	'Authorization': localStorage.getItem(`${urlPrefix}_token`)
}
/**
 * 登录
 * @param {user} params 
 */
export function login(params={}) {
	return requeat({
		url: `/${urlPrefix}/login`,
		method: 'post',
		params
	})
}

/**
 * 注册
 * @param {user} params 
 */
export function reguser(params={}){
	return requeat({
		url:`/${urlPrefix}/register`,
		method:'post',
		params
	})
}

// 获取招聘列表
export function getPosition(params={}){
	return requeat({
		url:`/${urlPrefix}/getPosition`,
		method:'post',
		headers:{
			'Authorization': localStorage.getItem(`${urlPrefix}_token`)
		},
		params
	})
}

// 获取招聘详情
export function getJobDetails(params={}){
	return requeat({
		url:`/${urlPrefix}/getJobDetails`,
		method:'get',
		headers:{
			'Authorization': localStorage.getItem(`${urlPrefix}_token`)
		},
		params
	})
}

export function getMsgList(params={}){
	return requeat({
		url:`/${urlPrefix}/getMsgList`,
		method:'get',
		headers:{
			'Authorization': localStorage.getItem(`${urlPrefix}_token`)
		},
		params
	})
}

